package com.shell.customer.base.rx;

import com.shell.customer.base.CusInfoModifyEvent;
import com.shell.customer.base.service.CusAcctService;
import com.shell.customer.po.CusAcct;
import com.shell.framework.rx.OnErrorNotImplementedSubscriber;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SaveCusAcctSubscriber extends OnErrorNotImplementedSubscriber<CusInfoModifyEvent<CusAcct>> {
	@Autowired
	private CusAcctService cusAcctService;

	public void onApplicationEvent(CusInfoModifyEvent<CusAcct> event) {
		CusAcct acct = (CusAcct) event.getT();

		this.cusAcctService.saveOrUpdate(acct);
	}
}
